Skip to content

Migrate Lingo memory ownership to Strata - #2

Open
zekageri wants to merge 25 commits into
mainfrom
strata-memory-policy
Open

Migrate Lingo memory ownership to Strata#2
zekageri wants to merge 25 commits into
mainfrom
strata-memory-policy

Conversation

@zekageri

@zekageri zekageri commented Sep 8, 2026

Copy link
Copy Markdown
Contributor

Summary

Migrates Lingo's bounded registry allocation to the shared ZekStack Strata memory policy and prepares Lingo v0.2.0.

Memory policy

  • add Strata v0.1.2 as a dependency
  • replace LingoConfig::preferPsram with Strata::MemoryPolicy
  • preserve the existing default with memory.allocation = Strata::Placement::PreferExternal
  • support Default, Internal, PreferExternal, and RequireExternal
  • validate the complete memory policy during init()

Ownership

  • route the registry through Strata::allocateArray / Strata::free
  • remove src/internal/LingoMemory.h
  • remove direct ESP-IDF heap capability usage and PSRAM allocation stubs
  • preserve the one-allocation-at-init design; registration and lookup remain allocation-free

Diagnostics

  • add LingoDiag
  • report requested registry Strata::Placement separately from observed Strata::Region

Tests and CI

  • replace ESP heap mocking with Strata generic-backend memory policy tests
  • add source auditing preventing direct heap ownership from returning
  • pin Strata v0.1.2 in CI
  • keep the ESP32 / S3 / C3 / P4 PlatformIO matrix
  • add matching Arduino CLI builds
  • isolate PlatformIO and Arduino CLI toolchain state under the runner temporary directory
  • remove multi-gigabyte ~/.platformio / ~/.arduino15 cache restores that exhausted self-hosted runner disks
  • clean temporary toolchain state after embedded builds
  • cancel superseded push/PR CI runs for the same branch so duplicate heavy matrices do not compete for runner storage

Release/docs

  • bump library metadata to v0.2.0
  • add v0.1.x migration guidance
  • update README, configuration, API, memory, troubleshooting, and examples

Compatibility

The former default preferPsram = true maps to Strata::Placement::PreferExternal, so normal runtime placement behavior is preserved. preferPsram = false migrates to Strata::Placement::Internal.

CI failure follow-up

The observed embedded matrix failure was caused by runner disk exhaustion, not by a Lingo/Strata compile error. GitHub Actions was restoring a roughly 3.4 GB PlatformIO cache into self-hosted runners that already contained persistent PlatformIO/Arduino state, eventually reaching 0 MB free and failing with No space left on device. The CI now uses disposable per-job toolchain directories and avoids those oversized persistent cache restores.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant